from pymysql import Connection

conn = Connection(host='localhost', port=3306, user='root', password='root', autocommit=True)
print(conn.get_server_info())
cursor = conn.cursor()
conn.select_db("server02_db")
sql = '''CREATE TABLE `user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;'''
cursor.execute(sql)
conn.close()